Get reports on operations in Yandex Fuel
This request is used to get information about operations in the Yandex Fuel service.
Request syntax
GET https://b2b-api.go.yandex.ru/integration/2.0/orders/tanker
Request headers
Authorization: Bearer <OAuth-token>
OAuth access token. The steps to get a token are described in Getting started.
X-YaTaxi-Selected-Corp-Client-Id— client ID from the account. Required if multiple clients are available using the token.
Request parameters
The request may contain the following optional parameters:
-
user_id: Employee ID. If this parameter is omitted, information about all users is returned. -
limit: The maximum number of orders in the response. Can take values from 1 to 1000. If this parameter is omitted, information about the first 100 records is returned. -
since_datetime: The start date of the report period. Set as a string in the formatYYYY-MM-DDThh:mm:ss.sssin UTC without a timezone. -
till_datetime: The end date of the report period. Set as a string in the formatYYYY-MM-DDThh:mm:ss.sssin UTC without a timezone.
Warning
The report is generated based on the order completion date (field order.closed_at).
The start date of the report period is included in the report, while the end date isn't: since_datetime <= order.closed_at till_datetime.
Response field description
The response contains the following fields:
| Field | Description | Format |
|---|---|---|
orders |
Array of orders. | Array |
last_closed_at |
The completion date of last order from the array orders. Has the format YYYY-MM-DDThh:mm:ss.sss in UTC without a timezone. If the array is empty , last_closed_at isn't returned. |
String |
Structure of the orders array element:
| Field | Description | Format |
|---|---|---|
id |
Order ID. | String |
client_id |
Client ID. | String |
user_id |
Employee ID. | String |
created_at |
Order creation date. | String |
closed_at |
Order completion date. | String |
fuel_type |
Fuel ID. For example, "a95_premium". |
String |
final_price |
The total cost charged from the client, including discounts. | String |
liters_filled |
The actual refuel volume. For example, "7.07". |
String |
station_location |
The location of the station in the format [<longitude>,<latitude] |
Array |
Request examples
-
The request will return no more than 100 of the client's first orders:
https://b2b-api.go.yandex.ru/integration/2.0/orders/tanker ... Authorization: Bearer <OAuth token> -
The request will return no more than the 50 first orders of the employee whose
idissome_user_id:https://b2b-api.go.yandex.ru/integration/2.0/orders/tanker?user_id=some_user_id&limit=50 ... Authorization: Bearer <OAuth token> -
The request will return no more than 100 orders in the period
[2022-05-12T13:32:49.123, 2022-05-15T06:11:52.834):https://b2b-api.go.yandex.ru/integration/2.0/orders/tanker?since_datetime=2022-05-12T13:32:49.123&since_datetime=2022-05-15T06:11:52.834 ... Authorization: Bearer <OAuth token>
Response example
An example response to this request looks like this:
{
"orders": [
{
"id": "bf8864bf487d485580ac661d03f37edf",
"client_id": "33f282a96cc544dcab412080a68f85e2",
"user_id": "bd0f307c9272456d9deb6f4dc51d8015",
"created_at": "2022-02-25T18:44:06.637000+03:00",
"closed_at": "2022-02-25T18:45:01.004000+03:00",
"fuel_type": "a92",
"final_price": "236.4",
"liters_filled": "5.0",
"station_location": [
37.8636,
51.341842
]
},
{
"id": "f0ec78666e4d429c999424b75dbc41d8",
"client_id": "33f282a96cc544dcab412080a68f85e2",
"user_id": "bb67674880ea456ba9a8fe470be8be45",
"created_at": "2022-03-11T22:23:35.798000+03:00",
"closed_at": "2022-03-11T22:25:07.939000+03:00",
"fuel_type": "a92_premium",
"final_price": "485.19",
"liters_filled": "10.55",
"station_location": [
37.874212,
55.822556
]
}
],
"last_closed_at": "2022-03-11T19:25:07.939000"
}
Response codes
The response to this request may contain the following standard HTTP codes:
200: Request completed successfully.400: An unknown parameter or a parameter with an invalid value was passed in the request.401: The OAuth token is incorrect.403: The client doesn't have sufficient rights to run this request.- SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header
X-YaTaxi-Selected-Corp-Client-Id(returned if more than one client is available for the token). - SELECTED_CLIENT_ACCESS_DENIED: the header
X-YaTaxi-Selected-Corp-Client-Idcontains the client's ID, which this login does not have access to.
- SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header